package com.gree.changying.activity.mainactivity.framgent.homefrm.tuijian.adapter;

import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.gree.changying.R;
import com.gree.changying.activity.mainactivity.framgent.homefrm.tuijian.bean.Rmmj;

import java.util.List;

public class RmmjAdapter extends BaseQuickAdapter<Rmmj, BaseViewHolder> {
    public RmmjAdapter(@LayoutRes int layoutResId, @Nullable List data) {
        super(layoutResId, data);
    }
    @Override
    protected void convert(BaseViewHolder helper, Rmmj item) {
        helper.setImageResource(R.id.img,item.getImg());
        helper.setText(R.id.name,item.getName());
        if(item.getSl()==0){
            helper.setVisible(R.id.slBox, false);
        }else{
            helper.setVisible(R.id.slBox, true);
            helper.setText(R.id.sl,item.getSl()+"%");
        }
    }
}